appService.service('ShellExecutorService', ['$resource', '$q', function ($resource, $q) {
    var shell_executor_resource = $resource('', {}, {
    	execute_command: {
            method: 'GET',
            url: '/command/execute?command=:cmd',
            isArray: false
        }
    });
    return {
    	execute_command: function (command) {
            var d = $q.defer();
            shell_executor_resource.execute_command({cmd:command.cmd},
            function (result) {
                d.resolve(result);
            }, function (result) {
                d.reject(result);
            });
            return d.promise;
        }
    }
}]);